//
//  THJDataBannerCell.m
//  THJXHW
//
//  Created by 河南德艺 on 2017/11/1.
//  Copyright © 2017年 河南德艺. All rights reserved.
//

#import "THJDataBannerCell.h"

@implementation THJDataBannerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setBannerWithImgUrlArr:(NSArray*)array Height:(NSInteger)height{
    if (cycleScrollView) {
        [cycleScrollView removeFromSuperview];
        cycleScrollView = nil;
    }
    NSLog(@"lunbo--%@",array);
    cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(10, 10, ScreenWidth - 20, height - 20) delegate:self placeholderImage:kGetImage(@"bannerplaceholder")];
        NSArray *imagesURLStrings = @[
                                      @"http://pic.58pic.com/58pic/11/30/94/24u58PICyts.jpg",
                                      @"http://pic.58pic.com/58pic/11/30/72/56b58PICAun.jpg",
                                      @"http://pic.qiantucdn.com/58pic/18/16/46/55dff36f92b5d_1024.jpg"
                                      ];
    if(array){
        cycleScrollView.imageURLStringsGroup = array;
    }else{
        cycleScrollView.imageURLStringsGroup = imagesURLStrings;
    }
    cycleScrollView.layer.cornerRadius = 5;
    cycleScrollView.showPageControl = YES;
    cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
    cycleScrollView.currentPageDotColor = COLOR(255, 68, 1, 1);
    cycleScrollView.layer.shadowColor = [UIColor grayColor].CGColor;//设置阴影的颜色
    cycleScrollView.layer.shadowOpacity = 0.8;//设置阴影的透明度
    cycleScrollView.layer.shadowOffset = CGSizeMake(3, 3);//设置阴影的偏移量
    cycleScrollView.layer.shadowRadius = 3;//设置阴影的圆角
    [self.contentView addSubview:cycleScrollView];
}
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{
    [self.delegate adImgSelectIndex:index];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
@end
